From e5935c15af0375240fa7c711dc99101fa48048be Mon Sep 17 00:00:00 2001 From: real-zephex Date: Wed, 10 Apr 2024 01:19:20 +0530 Subject: UI changes --- src/app/anime/[id]/buttons.jsx | 88 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/app/anime/[id]/buttons.jsx (limited to 'src/app/anime/[id]/buttons.jsx') diff --git a/src/app/anime/[id]/buttons.jsx b/src/app/anime/[id]/buttons.jsx new file mode 100644 index 0000000..eac1884 --- /dev/null +++ b/src/app/anime/[id]/buttons.jsx @@ -0,0 +1,88 @@ +"use client"; + +import styles from "./info.module.css"; +import { useState } from "react"; +import { fetch_video_link } from "../videoLinkfetcher"; +import { MediaPlayer, MediaProvider } from "@vidstack/react"; +import "@vidstack/react/player/styles/base.css"; +import "@vidstack/react/player/styles/plyr/theme.css"; +import { + PlyrLayout, + plyrLayoutIcons, +} from "@vidstack/react/player/layouts/plyr"; + +export default function Button({ data2: info }) { + const [videoLink, setVideoLink] = useState(null); + + async function video(id) { + const link = await fetch_video_link(id); + if (link === undefined) { + alert("Sorry, but not links were found"); + } else { + setVideoLink(link); + console.log(videoLink); + } + } + + return ( +
+

Episodes:

+
+ {info && + info.episodes && + info.episodes.map((item, index) => ( + + ))} +
+ + {videoLink && ( + + )} +
+ ); +} -- cgit v1.2.3